-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Welcome tab #13407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Welcome tab #13407
Conversation
jabgui/src/main/java/org/jabref/gui/welcome/QuickSettingsButton.java
Outdated
Show resolved
Hide resolved
…ngs to the welcome tab
Latest update drop:
|
JUnit tests of You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/components/QuickSettings.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/components/QuickSettings.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/components/QuickSettings.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/walkthrough/WalkthroughAction.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/welcome/components/PathSelectionField.java
Outdated
Show resolved
Hide resolved
private static List<Path> getCommonPaths() { | ||
List<Path> paths = new ArrayList<>(); | ||
|
||
if (OS.WINDOWS) { | ||
paths.addAll(List.of( | ||
Path.of("C:/Program Files"), | ||
Path.of("C:/Program Files (x86)"), | ||
Path.of(System.getProperty("user.home"), "AppData/Local"), | ||
Path.of(System.getProperty("user.home"), "AppData/Roaming") | ||
)); | ||
} else if (OS.OS_X) { | ||
paths.addAll(List.of( | ||
Path.of("/Applications"), | ||
Path.of("/usr/local/bin"), | ||
Path.of("/opt/homebrew/bin"), | ||
Path.of(System.getProperty("user.home"), "Applications"), | ||
Path.of("/usr/local/texlive"), | ||
Path.of("/Library/TeX/texbin") | ||
)); | ||
} else if (OS.LINUX) { | ||
paths.addAll(List.of( | ||
Path.of("/usr/bin"), | ||
Path.of("/usr/local/bin"), | ||
Path.of("/opt"), | ||
Path.of("/snap/bin"), | ||
Path.of(System.getProperty("user.home"), ".local/bin"), | ||
Path.of("/usr/local/texlive") | ||
)); | ||
} | ||
|
||
return paths; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppDirs package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly, this looks very bad... but honestly, I cannot think of a good place to put it. Maybe the Desktop.java can handle more of such a path.
As for Appdirs (https://github.com/harawata/appdirs), I don't think it provides a method where I can get those common software package locations. It's true that maybe I can get the user data path and start just CD around, but at this point I should simply be hardcoding it anyway?
The example output they have here:
User data dir: C:\Users\ave\AppData\Local\harawata\myapp\1.2.3
User data dir (roaming): C:\Users\ave\AppData\Roaming\harawata\myapp\1.2.3
User config dir: C:\Users\ave\AppData\Local\harawata\myapp\1.2.3
User config dir (roaming): C:\Users\ave\AppData\Roaming\harawata\myapp\1.2.3
User cache dir: C:\Users\ave\AppData\Local\harawata\myapp\Cache\1.2.3
User log dir: C:\Users\ave\AppData\Local\harawata\myapp\Logs\1.2.3
User downloads dir: C:\Users\ave\Downloads\harawata\myapp\1.2.3
Site data dir: C:\ProgramData\harawata\myapp\1.2.3
Site data dir (multi path): C:\ProgramData\harawata\myapp\1.2.3
Site config dir: C:\ProgramData\harawata\myapp\1.2.3
Site config dir (multi path): C:\ProgramData\harawata\myapp\1.2.3
Shared dir: C:\ProgramData\harawata\myapp\1.2.3
I figured the best I can achieve based on this is to take the shared directory and user cache directory and start CD-ing?
jabgui/src/main/java/org/jabref/gui/welcome/components/PushToApplicationDetector.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/resources/org/jabref/gui/welcome/components/ThemeWireFrame.fxml
Outdated
Show resolved
Hide resolved
.computeIfAbsent(key, _ -> createMainFileDirectoryWalkthrough(mainStage)); | ||
default -> | ||
throw new IllegalArgumentException("Unknown walkthrough name: " + name); | ||
// This will not crash application. If a new walkthrough is added and the developer tried the walkthrough that was added at least once, any mismatch will be caught here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment restates what is obvious from the code and doesn't provide additional value or reasoning. Such comments should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume if I remove this, you will say throwing an exception is discouraged and may interrupt the application...
jabgui/src/main/java/org/jabref/gui/welcome/components/QuickSettingsDialog.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/welcome/components/QuickSettingsDialog.java
Outdated
Show resolved
Hide resolved
jablib/src/main/java/org/jabref/logic/push/PushToApplicationDetector.java
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/components/QuickSettings.java
Outdated
Show resolved
Hide resolved
@Inject private GuiPreferences preferences; | ||
@Inject private DialogService dialogService; | ||
@Inject private TaskExecutor taskExecutor; | ||
@Inject private ThemeManager themeManager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Injected fields should be final to prevent accidental modification after initialization, following effective Java principles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I could make this final without initializing this to null in the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on how afterburner works. Please look for other places in code where this happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, cannot be final
...g/jabref/gui/welcome/quicksettings/viewmodel/OnlineServicesConfigurationDialogViewModel.java
Outdated
Show resolved
Hide resolved
helpButton.setHelpPage(URLs.PUSH_TO_APPLICATIONS_DOC); | ||
} | ||
|
||
private void updatePathValidation(String newText) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method handles GUI validation logic directly in the dialog class instead of delegating to the ViewModel, violating the separation of concerns principle.
public @NonNull String getGrobidUrl() { | ||
return grobidUrlProperty.get(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method returns direct property value which could be null, contradicting @nonnull annotation. Should include null check or use Optional to properly handle potential null values.
JUnit tests of You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide. |
Closes #12664
Video
Steps to test
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)